Only decrement internal waypt_ct if waypt_head is flushed.
authoroliskoli <oliskoli>
Mon, 5 Dec 2005 13:26:32 +0000 (13:26 +0000)
committeroliskoli <oliskoli>
Mon, 5 Dec 2005 13:26:32 +0000 (13:26 +0000)
waypt.c

diff --git a/waypt.c b/waypt.c
index bf1af9880417ae3bebf12abe228891ed422099ec..ddd66e0140c99cb5551a5746781759f262fe97e2 100644 (file)
--- a/waypt.c
+++ b/waypt.c
@@ -325,7 +325,9 @@ waypt_flush( queue *head )
        QUEUE_FOR_EACH(head, elem, tmp) {
                waypoint *q = (waypoint *) dequeue(elem);
                waypt_free(q);
-               waypt_ct--;
+               if (head == &waypt_head) {
+                       waypt_ct--;
+               }
        }
 }